package com.syqc.monitor.ui.carinfo

import android.content.Context
import android.graphics.drawable.ColorDrawable
import android.view.LayoutInflater
import android.widget.LinearLayout
import android.widget.PopupWindow
import com.syqc.monitor.databinding.PopupCarBaseBinding

class CarBasePopup(context: Context) : PopupWindow() {
    val binding = PopupCarBaseBinding.inflate(LayoutInflater.from(context))

    init {
        contentView = binding.root
        isFocusable = true //popupwindow设置焦点
        setBackgroundDrawable(ColorDrawable(-0x56000000)) //设置背景
        isOutsideTouchable = true //点击外面窗口消失
        width = LinearLayout.LayoutParams.MATCH_PARENT //设置SelectPicPopupWindow弹出窗体的宽
        height = LinearLayout.LayoutParams.MATCH_PARENT //设置SelectPicPopupWindow弹出窗体的高
        isClippingEnabled = false //设置是否裁剪内容
        binding.llCarBase.setOnClickListener {
            dismiss()
        }
    }
}